/*
               File: WPPrincipal
        Description: WPPrincipal
             Author: GeneXus C# Generator version 10_1_5-40140
       Generated on: 2/22/2011 13:38:19.23
       Program type: Callable routine
          Main DBMS: sqlserver
*/
using System;
using System.Collections;
using GeneXus.Utils;
using GeneXus.Resources;
using GeneXus.Application;
using GeneXus.Metadata;
using System.Data;
using System.Data.SqlClient;
using GeneXus.Data;
using com.genexus;
using GeneXus.Data.ADO;
using GeneXus.Data.NTier;
using GeneXus.Data.NTier.ADO;
using System.Runtime.Remoting;
using GeneXus.WebControls;
using GeneXus.Http;
using GeneXus.XML;
using GeneXus.Search;
using GeneXus.Encryption;
using GeneXus.Http.Client;
using System.Xml.Serialization;
using System.Data.SqlTypes;
namespace GeneXus.Programs {
   public class wpprincipal : GXDataArea, System.Web.SessionState.IRequiresSessionState
   {
      public wpprincipal( )
      {
         context = new GxContext(  );
         DataStoreUtil.LoadDataStores( context);
         dsDefault = context.GetDataStore("Default") ;
         IsMain = true;
         context.SetTheme("Fantastic");
      }

      public wpprincipal( IGxContext context )
      {
         this.context = context;
         IsMain = false;
         dsDefault = context.GetDataStore("Default") ;
      }

      public void release( )
      {
      }

      public void execute( )
      {
         executePrivate();
      }

      void executePrivate( )
      {
         isStatic = false;
         webExecute();
      }

      protected override void createObjects( )
      {
      }

      protected void INITWEB( )
      {
         initialize_properties( ) ;
         if ( nGotPars == 0 )
         {
            entryPointCalled = false ;
            gxfirstwebparm = GetNextPar( ) ;
            gxfirstwebparm_bkp = gxfirstwebparm ;
            gxfirstwebparm = DecryptAjaxCall( gxfirstwebparm, "High") ;
            if ( StringUtil.StrCmp(gxfirstwebparm, "dyncall") == 0 )
            {
               setAjaxCallMode();
               if ( ! IsValidAjaxCall( true) )
               {
                  GxWebError = 1 ;
                  return  ;
               }
               dyncall( GetNextPar( )) ;
               return  ;
            }
            else if ( StringUtil.StrCmp(gxfirstwebparm, "gxajaxEvt") == 0 )
            {
               setAjaxEventMode();
               if ( ! IsValidAjaxCall( true) )
               {
                  GxWebError = 1 ;
                  return  ;
               }
               gxfirstwebparm = GetNextPar( ) ;
            }
            else if ( StringUtil.StrCmp(gxfirstwebparm, "gxajaxNewRow_"+"Grid2") == 0 )
            {
               nRC_Grid2 = (short)(NumberUtil.Val( GetNextPar( ), ".")) ;
               nGXsfl_21_idx = (short)(NumberUtil.Val( GetNextPar( ), ".")) ;
               sGXsfl_21_idx = GetNextPar( ) ;
               setAjaxCallMode();
               if ( ! IsValidAjaxCall( true) )
               {
                  GxWebError = 1 ;
                  return  ;
               }
               gxnrGrid2_newrow( nRC_Grid2, nGXsfl_21_idx, sGXsfl_21_idx) ;
               return  ;
            }
            else if ( StringUtil.StrCmp(gxfirstwebparm, "gxajaxGridRefresh_"+"Grid2") == 0 )
            {
               /* GeneXus formulas. */
               context.Gx_err = 0 ;
               Grid2_PageSize21 = (int)(NumberUtil.Val( GetNextPar( ), ".")) ;
               A25CursoId = (short)(NumberUtil.Val( GetNextPar( ), ".")) ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A25CursoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A25CursoId), 4, 0)));
               setAjaxCallMode();
               if ( ! IsValidAjaxCall( true) )
               {
                  GxWebError = 1 ;
                  return  ;
               }
               gxgrGrid2_refresh( Grid2_PageSize21, A25CursoId) ;
               return  ;
            }
            else if ( StringUtil.StrCmp(gxfirstwebparm, "gxajaxNewRow_"+"Grid1") == 0 )
            {
               nRC_Grid1 = (short)(NumberUtil.Val( GetNextPar( ), ".")) ;
               nGXsfl_6_idx = (short)(NumberUtil.Val( GetNextPar( ), ".")) ;
               sGXsfl_6_idx = GetNextPar( ) ;
               setAjaxCallMode();
               if ( ! IsValidAjaxCall( true) )
               {
                  GxWebError = 1 ;
                  return  ;
               }
               gxnrGrid1_newrow( nRC_Grid1, nGXsfl_6_idx, sGXsfl_6_idx) ;
               return  ;
            }
            else if ( StringUtil.StrCmp(gxfirstwebparm, "gxajaxGridRefresh_"+"Grid1") == 0 )
            {
               /* GeneXus formulas. */
               context.Gx_err = 0 ;
               ajax_req_read_hidden_sdt(GetNextPar( ), (Object)(AV5Context));
               setAjaxCallMode();
               if ( ! IsValidAjaxCall( true) )
               {
                  GxWebError = 1 ;
                  return  ;
               }
               gxgrGrid1_refresh( AV5Context) ;
               return  ;
            }
            else
            {
               if ( ! IsValidAjaxCall( false) )
               {
                  GxWebError = 1 ;
                  return  ;
               }
               gxfirstwebparm = gxfirstwebparm_bkp ;
            }
         }
         context.SetTheme("Fantastic");
      }

      public override void webExecute( )
      {
         if ( initialized == 0 )
         {
            createObjects();
            initialize();
         }
         INITWEB( ) ;
         if ( ! isAjaxCallMode( ) )
         {
            MasterPageObj = (GXMasterPage) ClassLoader.GetInstance("appmasterpage", "GeneXus.Programs.appmasterpage", new Object[] {new GxContext( context.handle, context.DataStores, context.HttpContext)});
            MasterPageObj.setDataArea(this,false);
            MasterPageObj.webExecute();
            if ( context.isAjaxRequest( ) )
            {
               enableOutput();
               if ( ! context.isAjaxRequest( ) )
               {
                  context.GX_webresponse.AppendHeader("Cache-Control", "max-age=0");
               }
               if ( String.IsNullOrEmpty(StringUtil.RTrim( context.wjLoc)) )
               {
                  context.GX_webresponse.AddString((String)(context.getJSONResponse( )));
               }
               else
               {
                  context.Redirect( context.wjLoc );
                  context.DispatchAjaxCommands();
               }
            }
         }
         this.cleanup();
      }

      public override short ExecuteStartEvent( )
      {
         PA112( ) ;
         gxajaxcallmode = (short)((isAjaxCallMode( ) ? 1 : 0)) ;
         if ( ( gxajaxcallmode == 0 ) && ( GxWebError == 0 ) )
         {
            START112( ) ;
         }
         return gxajaxcallmode ;
      }

      public override void RenderHtmlHeaders( )
      {
         GxWebStd.gx_html_headers( context, 0, "", "", Form.Meta, Form.Metaequiv, "IE=EmulateIE7");
      }

      public override void RenderHtmlOpenForm( )
      {
         context.WriteHtmlText( "<title>") ;
         context.WriteHtmlText( Form.Caption) ;
         context.WriteHtmlTextNl( "</title>") ;
         if ( StringUtil.Len( sDynURL) > 0 )
         {
            context.WriteHtmlText( "<BASE href=\""+sDynURL+"\" />") ;
         }
         define_styles( ) ;
         if ( nGXWrapped != 1 )
         {
            MasterPageObj.master_styles();
         }
         if ( ! context.isSmartDevice( ) )
         {
            context.AddJavascriptSource("gxgral.js", "?40140");
            context.AddJavascriptSource("gxcfg.js", "?40140");
         }
         else
         {
            context.AddJavascriptSource("gxapiSD.js", "?40140");
            context.AddJavascriptSource("gxfxSD.js", "?40140");
            context.AddJavascriptSource("gxtypesSD.js", "?40140");
            context.AddJavascriptSource("gxpopupSD.js", "?40140");
            context.AddJavascriptSource("gxfrmutlSD.js", "?40140");
            context.AddJavascriptSource("gxgridSD.js", "?40140");
            context.AddJavascriptSource("JavaScripTableSD.js", "?40140");
            context.AddJavascriptSource("rijndaelSD.js", "?40140");
            context.AddJavascriptSource("gxgralSD.js", "?40140");
            context.AddJavascriptSource("gxcfg.js", "?40140");
         }
         context.WriteHtmlText( Form.Headerrawhtml) ;
         context.CloseHtmlHeader();
         FormProcess = ((nGXWrapped==0) ? " onkeyup=\"gx.evt.onkeyup(event)\" onkeypress=\"gx.evt.onkeypress(event,false,false)\" onkeydown=\"gx.evt.onkeypress(null,false,false)\"" : "") ;
         context.WriteHtmlText( "<body") ;
         if ( ! ( String.IsNullOrEmpty(StringUtil.RTrim( Form.Background)) ) )
         {
            context.WriteHtmlText( " background=\""+context.convertURL( Form.Background)+"\"") ;
         }
         context.WriteHtmlText( " "+"class=\"Form\""+" "+" style=\"-moz-opacity:0;opacity:0;"+"background-color:"+context.BuildHTMLColor( Form.Backcolor)+"\""+FormProcess+">") ;
         context.skipLines(1);
         if ( nGXWrapped != 1 )
         {
            context.WriteHtmlTextNl( "<form id=\"MAINFORM\" onsubmit=\"try{return gx.csv.validForm()}catch(e){return true;}\" name=\"MAINFORM\" method=\"post\" action=\""+formatLink("wpprincipal.aspx") +"\" class=\""+"Form"+"\">") ;
            GxWebStd.gx_hidden_field( context, "_EventName", "");
            GxWebStd.gx_hidden_field( context, "_EventGridId", "");
            GxWebStd.gx_hidden_field( context, "_EventRowId", "");
         }
      }

      public override void RenderHtmlCloseForm( )
      {
         /* Send hidden variables. */
         /* Send saved values. */
         GxWebStd.gx_hidden_field( context, "nRC_Grid1", StringUtil.LTrim( StringUtil.NToC( (decimal)(nRC_Grid1), 4, 0, ",", "")));
         if ( context.isAjaxRequest( ) )
         {
            context.httpAjaxContext.ajax_rsp_assign_sdt_attri("", false, "vCONTEXT", (Object)(AV5Context));
         }
         else
         {
            context.httpAjaxContext.ajax_rsp_assign_hidden_sdt("vCONTEXT", (Object)(AV5Context));
         }
         GxWebStd.gx_hidden_field( context, "PROFESORNOMBRE", StringUtil.RTrim( A20ProfesorNombre));
         GxWebStd.gx_hidden_field( context, "PROFESORAPELLIDOS", StringUtil.RTrim( A19ProfesorApellidos));
         GxWebStd.gx_hidden_field( context, "ALUMNONOMBRE", StringUtil.RTrim( A2AlumnoNombre));
         GxWebStd.gx_hidden_field( context, "ALUMNOAPELLIDOS", StringUtil.RTrim( A3AlumnoApellidos));
         GxWebStd.gx_hidden_field( context, "GX_FocusControl", GX_FocusControl);
         SendAjaxEncryptionKey();
         SendComponentObjects();
         SendServerCommands();
         SendState();
         if ( nGXWrapped != 1 )
         {
            context.WriteHtmlTextNl( "</form>") ;
         }
         include_jscripts( ) ;
      }

      public override void RenderHtmlContent( )
      {
         gxajaxcallmode = (short)((isAjaxCallMode( ) ? 1 : 0)) ;
         if ( ( gxajaxcallmode == 0 ) && ( GxWebError == 0 ) )
         {
            WE112( ) ;
         }
      }

      public override void DispatchEvents( )
      {
         EVT112( ) ;
      }

      public override bool HasEnterEvent( )
      {
         return false ;
      }

      public override String GetPgmname( )
      {
         return "WPPrincipal" ;
      }

      public override String GetPgmdesc( )
      {
         return "WPPrincipal" ;
      }

      public override GXWebForm GetForm( )
      {
         return Form ;
      }

      public override String GetSelfLink( )
      {
         return formatLink("wpprincipal.aspx")  ;
      }

      protected void WB110( )
      {
         if ( context.isAjaxRequest( ) )
         {
            disableOutput();
         }
         if ( ! wbLoad )
         {
            if ( nGXWrapped == 1 )
            {
               RenderHtmlHeaders( ) ;
               RenderHtmlOpenForm( ) ;
            }
            GxWebStd.gx_msg_list( context, "", context.GX_msglist.DisplayMode, "", "", "", "false");
            context.WriteHtmlText( "<p>") ;
            /* Single line edit */
            ClassString = "GrandeNaranja" ;
            StyleString = "" ;
            GxWebStd.gx_single_line_edit( context, edtProfesorNombreCompleto_Internalname, StringUtil.RTrim( A21ProfesorNombreCompleto), "", 80, "chr", 1, "row", 220, 1, 0, 0, 0, 0, "", "", StyleString, ClassString, "", StringUtil.RTrim( context.localUtil.Format( A21ProfesorNombreCompleto, "")), "", 0, edtProfesorNombreCompleto_Jsonclick, "", 0, 1, 1, true, "left", "HLP_WPPrincipal.htm");
            context.WriteHtmlText( "</p>") ;
            context.WriteHtmlText( "<p>") ;
            /*  Grid Control  */
            Grid1Container.SetIsFreestyle(true);
            Grid1Container.SetWrapped(nGXWrapped);
            if ( Grid1Container.GetWrapped() == 1 )
            {
               sStyleString = "" ;
               if ( StringUtil.StrCmp(context.BuildHTMLColor( (int)(0x800000))+";", "") != 0 )
               {
                  sStyleString = sStyleString + " border-color: " + context.BuildHTMLColor( (int)(0x800000)) + ";" ;
               }
               GxWebStd.gx_table_start( context, subGrid1_Internalname, subGrid1_Internalname, "", "FreeStyleGrid", 0, "", "", 2, 3, sStyleString, "none", 0);
            }
            else
            {
               Grid1Container.Clear();
               Grid1Container.SetIsFreestyle(true);
               Grid1Container.SetWrapped(nGXWrapped);
               Grid1Container.AddObjectProperty("GridName", "Grid1");
               Grid1Container.AddObjectProperty("Background", StringUtil.RTrim( ""));
               Grid1Container.AddObjectProperty("Bordercolor", StringUtil.LTrim( StringUtil.NToC( (decimal)((int)(0x800000)), 9, 0, ".", "")));
               Grid1Container.AddObjectProperty("Borderwidth", StringUtil.LTrim( StringUtil.NToC( (decimal)(0), 4, 0, ".", "")));
               Grid1Container.AddObjectProperty("Cellpadding", StringUtil.LTrim( StringUtil.NToC( (decimal)(2), 4, 0, ".", "")));
               Grid1Container.AddObjectProperty("Cellspacing", StringUtil.LTrim( StringUtil.NToC( (decimal)(3), 4, 0, ".", "")));
               Grid1Container.AddObjectProperty("Rules", StringUtil.RTrim( "none"));
               Grid1Container.AddObjectProperty("Class", "FreeStyleGrid");
               Grid1Container.AddObjectProperty("Cellpadding", StringUtil.LTrim( StringUtil.NToC( (decimal)(2), 4, 0, ".", "")));
               Grid1Container.AddObjectProperty("Cellspacing", StringUtil.LTrim( StringUtil.NToC( (decimal)(3), 4, 0, ".", "")));
               Grid1Container.AddObjectProperty("Backcolorstyle", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGrid1_Backcolorstyle), 1, 0, ".", "")));
               Grid1Container.AddObjectProperty("Borderwidth", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGrid1_Borderwidth), 4, 0, ".", "")));
               Grid1Container.AddObjectProperty("Bordercolor", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGrid1_Bordercolor), 9, 0, ".", "")));
               Grid1Container.AddObjectProperty("CmpContext", "");
               Grid1Container.AddObjectProperty("InMasterPage", "false");
               Grid1Column = GXWebColumn.GetNew(isAjaxCallMode( )) ;
               Grid1Container.AddColumnProperties(Grid1Column);
               Grid1Column = GXWebColumn.GetNew(isAjaxCallMode( )) ;
               Grid1Container.AddColumnProperties(Grid1Column);
               Grid1Column = GXWebColumn.GetNew(isAjaxCallMode( )) ;
               Grid1Container.AddColumnProperties(Grid1Column);
               Grid1Column = GXWebColumn.GetNew(isAjaxCallMode( )) ;
               Grid1Container.AddColumnProperties(Grid1Column);
               Grid1Column = GXWebColumn.GetNew(isAjaxCallMode( )) ;
               Grid1Container.AddColumnProperties(Grid1Column);
               Grid1Column = GXWebColumn.GetNew(isAjaxCallMode( )) ;
               Grid1Container.AddColumnProperties(Grid1Column);
               Grid1Column = GXWebColumn.GetNew(isAjaxCallMode( )) ;
               Grid1Container.AddColumnProperties(Grid1Column);
               Grid1Column = GXWebColumn.GetNew(isAjaxCallMode( )) ;
               Grid1Container.AddColumnProperties(Grid1Column);
               Grid1Column = GXWebColumn.GetNew(isAjaxCallMode( )) ;
               Grid1Column.AddObjectProperty("Value", lblTextblock1_Caption);
               Grid1Container.AddColumnProperties(Grid1Column);
               Grid1Column = GXWebColumn.GetNew(isAjaxCallMode( )) ;
               Grid1Column.AddObjectProperty("Value", StringUtil.LTrim( StringUtil.NToC( (decimal)(A25CursoId), 4, 0, ".", "")));
               Grid1Column.AddObjectProperty("Visible", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtCursoId_Visible), 5, 0, ".", "")));
               Grid1Container.AddColumnProperties(Grid1Column);
               Grid1Column = GXWebColumn.GetNew(isAjaxCallMode( )) ;
               Grid1Column.AddObjectProperty("Value", StringUtil.RTrim( A26CursoNombre));
               Grid1Column.AddObjectProperty("Link", StringUtil.RTrim( edtCursoNombre_Link));
               Grid1Container.AddColumnProperties(Grid1Column);
               Grid1Column = GXWebColumn.GetNew(isAjaxCallMode( )) ;
               Grid1Column.AddObjectProperty("Value", StringUtil.RTrim( A29CursoDescripcion));
               Grid1Container.AddColumnProperties(Grid1Column);
               Grid1Column = GXWebColumn.GetNew(isAjaxCallMode( )) ;
               Grid1Container.AddColumnProperties(Grid1Column);
               Grid1Column = GXWebColumn.GetNew(isAjaxCallMode( )) ;
               Grid1Container.AddColumnProperties(Grid1Column);
               Grid1Container.AddObjectProperty("Allowselection", "true");
               Grid1Container.AddObjectProperty("Selectioncolor", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGrid1_Selectioncolor), 9, 0, ".", "")));
               Grid1Container.AddObjectProperty("Allowhover", "true");
               Grid1Container.AddObjectProperty("Hovercolor", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGrid1_Hoveringcolor), 9, 0, ".", "")));
               Grid1Container.AddObjectProperty("Allowcollapsing", "false");
               Grid1Container.AddObjectProperty("Collapsed", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGrid1_Collapsed), 9, 0, ".", "")));
            }
         }
         if ( wbEnd == 6 )
         {
            wbEnd = 0 ;
            nRC_Grid1 = (short)(nGXsfl_6_idx-1) ;
            if ( Grid1Container.GetWrapped() == 1 )
            {
               context.WriteHtmlText( "</table>") ;
            }
            else
            {
               sStyleString = " style=\"display:none;\"" ;
               sStyleString = "" ;
               context.WriteHtmlText( "<div id=\""+"Grid1Container"+"Div\" "+sStyleString+">"+"</div>") ;
               context.httpAjaxContext.ajax_rsp_assign_grid("_"+"Grid1", (Object)(Grid1Container));
               GxWebStd.gx_hidden_field( context, "Grid1ContainerData", Grid1Container.ToJavascriptSource());
               if ( context.isAjaxRequest( ) )
               {
                  GxWebStd.gx_hidden_field( context, "Grid1ContainerData"+"V", Grid1Container.GridValuesHidden());
               }
               else
               {
                  context.WriteHtmlText( "<input type=\"hidden\" "+"name=\""+"Grid1ContainerData"+"V"+"\" value='"+Grid1Container.GridValuesHidden()+"'>") ;
               }
            }
            context.WriteHtmlText( "</p>") ;
            context.WriteHtmlText( "<p></p>") ;
            context.WriteHtmlText( "<p></p>") ;
         }
         wbLoad = true ;
      }

      protected void START112( )
      {
         wbLoad = false ;
         wbEnd = 0 ;
         wbStart = 0 ;
         Form.Meta.addItem("Generator", "GeneXus C#", 0) ;
         Form.Meta.addItem("Version", "10_1_5-40140", 0) ;
         Form.Meta.addItem("Description", "WPPrincipal", 0) ;
         context.wjLoc = "" ;
         context.nUserReturn = 0 ;
         context.wbHandled = 0 ;
         if ( StringUtil.StrCmp(context.GetRequestMethod( ), "POST") == 0 )
         {
         }
         wbErr = false ;
         STRUP110( ) ;
      }

      protected void WS112( )
      {
         START112( ) ;
         EVT112( ) ;
      }

      protected void EVT112( )
      {
         if ( StringUtil.StrCmp(context.GetRequestMethod( ), "POST") == 0 )
         {
            if ( String.IsNullOrEmpty(StringUtil.RTrim( context.wjLoc)) && ( context.nUserReturn != 1 ) && ! wbErr )
            {
               /* Read Web Panel buttons. */
               sEvt = cgiGet( "_EventName") ;
               EvtGridId = cgiGet( "_EventGridId") ;
               EvtRowId = cgiGet( "_EventRowId") ;
               if ( StringUtil.Len( sEvt) > 0 )
               {
                  sEvtType = StringUtil.Left( sEvt, 1) ;
                  sEvt = StringUtil.Right( sEvt, (short)(StringUtil.Len( sEvt)-1)) ;
                  /* Check if conditions changed and reset current page numbers */
                  if ( StringUtil.StrCmp(sEvtType, "M") != 0 )
                  {
                     if ( StringUtil.StrCmp(sEvtType, "E") == 0 )
                     {
                        sEvtType = StringUtil.Right( sEvt, 1) ;
                        if ( StringUtil.StrCmp(sEvtType, ".") == 0 )
                        {
                           sEvt = StringUtil.Left( sEvt, (short)(StringUtil.Len( sEvt)-1)) ;
                           if ( StringUtil.StrCmp(sEvt, "RFR") == 0 )
                           {
                              context.wbHandled = 1 ;
                              dynload_actions( ) ;
                           }
                           else if ( StringUtil.StrCmp(sEvt, "LSCR") == 0 )
                           {
                              context.wbHandled = 1 ;
                              dynload_actions( ) ;
                           }
                           else if ( StringUtil.StrCmp(sEvt, "GRID2PAGING") == 0 )
                           {
                              context.wbHandled = 1 ;
                              sEvt = cgiGet( "GRID2PAGING") ;
                              if ( StringUtil.StrCmp(sEvt, "FIRST") == 0 )
                              {
                                 subgrid2_firstpage( ) ;
                              }
                              else if ( StringUtil.StrCmp(sEvt, "PREV") == 0 )
                              {
                                 subgrid2_previouspage( ) ;
                              }
                              else if ( StringUtil.StrCmp(sEvt, "NEXT") == 0 )
                              {
                                 subgrid2_nextpage( ) ;
                              }
                              else if ( StringUtil.StrCmp(sEvt, "LAST") == 0 )
                              {
                                 subgrid2_lastpage( ) ;
                              }
                           }
                        }
                        else
                        {
                           sEvtType = StringUtil.Right( sEvt, 4) ;
                           sEvt = StringUtil.Left( sEvt, (short)(StringUtil.Len( sEvt)-4)) ;
                           if ( ( StringUtil.StrCmp(StringUtil.Left( sEvt, 10), "GRID1.LOAD") == 0 ) || ( StringUtil.StrCmp(StringUtil.Left( sEvt, 5), "START") == 0 ) || ( StringUtil.StrCmp(StringUtil.Left( sEvt, 5), "ENTER") == 0 ) || ( StringUtil.StrCmp(StringUtil.Left( sEvt, 6), "CANCEL") == 0 ) || ( StringUtil.StrCmp(StringUtil.Left( sEvt, 10), "GRID2.LOAD") == 0 ) )
                           {
                              nGXsfl_6_idx = (short)(NumberUtil.Val( sEvtType, ".")) ;
                              sGXsfl_6_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_6_idx), 4, 0)), 4, "0") ;
                              lblTextblock1_Internalname = "TEXTBLOCK1_"+sGXsfl_6_idx ;
                              edtCursoId_Internalname = "CURSOID_"+sGXsfl_6_idx ;
                              edtCursoNombre_Internalname = "CURSONOMBRE_"+sGXsfl_6_idx ;
                              edtCursoDescripcion_Internalname = "CURSODESCRIPCION_"+sGXsfl_6_idx ;
                              subGrid2_Internalname = "GRID2_"+sGXsfl_6_idx ;
                              A25CursoId = (short)(context.localUtil.CToN( cgiGet( edtCursoId_Internalname), ",", ".")) ;
                              context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A25CursoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A25CursoId), 4, 0)));
                              A26CursoNombre = cgiGet( edtCursoNombre_Internalname) ;
                              context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A26CursoNombre", A26CursoNombre);
                              A29CursoDescripcion = cgiGet( edtCursoDescripcion_Internalname) ;
                              context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A29CursoDescripcion", A29CursoDescripcion);
                              GXCCtl = "GRID2_nFirstRecordOnPage_" + sGXsfl_6_idx ;
                              GRID2_nFirstRecordOnPage = (int)(context.localUtil.CToN( cgiGet( GXCCtl), ",", ".")) ;
                              GXCCtl = "GRID2_nEOF_" + sGXsfl_6_idx ;
                              GRID2_nEOF = (short)(context.localUtil.CToN( cgiGet( GXCCtl), ",", ".")) ;
                              GXCCtl = "nRC_Grid2_" + sGXsfl_6_idx ;
                              nRC_Grid2 = (short)(context.localUtil.CToN( cgiGet( GXCCtl), ",", ".")) ;
                              sEvtType = StringUtil.Right( sEvt, 1) ;
                              if ( StringUtil.StrCmp(sEvtType, ".") == 0 )
                              {
                                 sEvt = StringUtil.Left( sEvt, (short)(StringUtil.Len( sEvt)-1)) ;
                                 if ( StringUtil.StrCmp(sEvt, "GRID1.LOAD") == 0 )
                                 {
                                    context.wbHandled = 1 ;
                                    dynload_actions( ) ;
                                    /* Execute user event: E11112 */
                                    E11112 ();
                                 }
                                 else if ( StringUtil.StrCmp(sEvt, "START") == 0 )
                                 {
                                    context.wbHandled = 1 ;
                                    dynload_actions( ) ;
                                    /* Execute user event: E12112 */
                                    E12112 ();
                                 }
                                 else if ( StringUtil.StrCmp(sEvt, "ENTER") == 0 )
                                 {
                                    context.wbHandled = 1 ;
                                    if ( ! wbErr )
                                    {
                                       Rfr0gs = false ;
                                       if ( ! Rfr0gs )
                                       {
                                       }
                                       dynload_actions( ) ;
                                    }
                                 }
                                 else if ( StringUtil.StrCmp(sEvt, "CANCEL") == 0 )
                                 {
                                    context.wbHandled = 1 ;
                                    dynload_actions( ) ;
                                 }
                                 else if ( StringUtil.StrCmp(sEvt, "LSCR") == 0 )
                                 {
                                    context.wbHandled = 1 ;
                                    dynload_actions( ) ;
                                 }
                              }
                              else
                              {
                                 sEvtType = StringUtil.Right( sEvt, 4) ;
                                 sEvt = StringUtil.Left( sEvt, (short)(StringUtil.Len( sEvt)-4)) ;
                                 if ( StringUtil.StrCmp(StringUtil.Left( sEvt, 10), "GRID2.LOAD") == 0 )
                                 {
                                    nGXsfl_21_idx = (short)(NumberUtil.Val( sEvtType, ".")) ;
                                    sGXsfl_21_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_21_idx), 4, 0)), 4, "0") + sGXsfl_6_idx ;
                                    edtAlumnoId_Internalname = "ALUMNOID_"+sGXsfl_21_idx ;
                                    edtAlumnoNombreCompleto_Internalname = "ALUMNONOMBRECOMPLETO_"+sGXsfl_21_idx ;
                                    edtAlumnoEmail_Internalname = "ALUMNOEMAIL_"+sGXsfl_21_idx ;
                                    A1AlumnoId = (short)(context.localUtil.CToN( cgiGet( edtAlumnoId_Internalname), ",", ".")) ;
                                    context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A1AlumnoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A1AlumnoId), 4, 0)));
                                    A4AlumnoNombreCompleto = cgiGet( edtAlumnoNombreCompleto_Internalname) ;
                                    context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A4AlumnoNombreCompleto", A4AlumnoNombreCompleto);
                                    A30AlumnoEmail = cgiGet( edtAlumnoEmail_Internalname) ;
                                    n30AlumnoEmail = false ;
                                    context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A30AlumnoEmail", A30AlumnoEmail);
                                    sEvtType = StringUtil.Right( sEvt, 1) ;
                                    if ( StringUtil.StrCmp(sEvtType, ".") == 0 )
                                    {
                                       sEvt = StringUtil.Left( sEvt, (short)(StringUtil.Len( sEvt)-1)) ;
                                       if ( StringUtil.StrCmp(sEvt, "GRID2.LOAD") == 0 )
                                       {
                                          context.wbHandled = 1 ;
                                          dynload_actions( ) ;
                                          /* Execute user event: E13113 */
                                          E13113 ();
                                       }
                                       else if ( StringUtil.StrCmp(sEvt, "LSCR") == 0 )
                                       {
                                          context.wbHandled = 1 ;
                                          dynload_actions( ) ;
                                       }
                                    }
                                    else
                                    {
                                    }
                                 }
                              }
                           }
                        }
                     }
                     context.wbHandled = 1 ;
                  }
               }
            }
         }
      }

      protected void WE112( )
      {
         if ( ! GxWebStd.gx_redirect( context) )
         {
            Rfr0gs = true ;
            Refresh( ) ;
            if ( ! GxWebStd.gx_redirect( context) )
            {
               if ( nGXWrapped == 1 )
               {
                  RenderHtmlCloseForm( ) ;
               }
            }
         }
      }

      protected void PA112( )
      {
         if ( nDonePA == 0 )
         {
            nDonePA = 1 ;
         }
      }

      protected void dynload_actions( )
      {
         /* End function dynload_actions */
      }

      protected void gxnrGrid1_newrow( short nRC_Grid1 ,
                                       short nGXsfl_6_idx ,
                                       String sGXsfl_6_idx )
      {
         GxWebStd.set_html_headers( context, 0, "", "");
         lblTextblock1_Internalname = "TEXTBLOCK1_"+sGXsfl_6_idx ;
         edtCursoId_Internalname = "CURSOID_"+sGXsfl_6_idx ;
         edtCursoNombre_Internalname = "CURSONOMBRE_"+sGXsfl_6_idx ;
         edtCursoDescripcion_Internalname = "CURSODESCRIPCION_"+sGXsfl_6_idx ;
         subGrid2_Internalname = "GRID2_"+sGXsfl_6_idx ;
         while ( nGXsfl_6_idx <= nRC_Grid1 )
         {
            sendrow_62( ) ;
            nGXsfl_6_idx = (short)(((subGrid1_Islastpage==1)&&(nGXsfl_6_idx+1>subGrid1_Recordsperpage( )) ? 1 : nGXsfl_6_idx+1)) ;
            sGXsfl_6_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_6_idx), 4, 0)), 4, "0") ;
            lblTextblock1_Internalname = "TEXTBLOCK1_"+sGXsfl_6_idx ;
            edtCursoId_Internalname = "CURSOID_"+sGXsfl_6_idx ;
            edtCursoNombre_Internalname = "CURSONOMBRE_"+sGXsfl_6_idx ;
            edtCursoDescripcion_Internalname = "CURSODESCRIPCION_"+sGXsfl_6_idx ;
            subGrid2_Internalname = "GRID2_"+sGXsfl_6_idx ;
         }
         context.GX_webresponse.AddString(Grid1Container.ToJavascriptSource());
         /* End function gxnrGrid1_newrow */
      }

      protected void gxnrGrid2_newrow( short nRC_Grid2 ,
                                       short nGXsfl_21_idx ,
                                       String sGXsfl_21_idx )
      {
         GxWebStd.set_html_headers( context, 0, "", "");
         edtAlumnoId_Internalname = "ALUMNOID_"+sGXsfl_21_idx ;
         edtAlumnoNombreCompleto_Internalname = "ALUMNONOMBRECOMPLETO_"+sGXsfl_21_idx ;
         edtAlumnoEmail_Internalname = "ALUMNOEMAIL_"+sGXsfl_21_idx ;
         while ( nGXsfl_21_idx <= nRC_Grid2 )
         {
            sendrow_213( ) ;
            nGXsfl_21_idx = (short)(((subGrid2_Islastpage==1)&&(nGXsfl_21_idx+1>subGrid2_Recordsperpage( )) ? 1 : nGXsfl_21_idx+1)) ;
            sGXsfl_21_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_21_idx), 4, 0)), 4, "0") + sGXsfl_6_idx ;
            edtAlumnoId_Internalname = "ALUMNOID_"+sGXsfl_21_idx ;
            edtAlumnoNombreCompleto_Internalname = "ALUMNONOMBRECOMPLETO_"+sGXsfl_21_idx ;
            edtAlumnoEmail_Internalname = "ALUMNOEMAIL_"+sGXsfl_21_idx ;
         }
         context.GX_webresponse.AddString(Grid2Container.ToJavascriptSource());
         /* End function gxnrGrid2_newrow */
      }

      protected void gxgrGrid2_refresh( int Grid2_PageSize21 ,
                                        short A25CursoId )
      {
         GxWebStd.set_html_headers( context, 0, "", "");
         disableOutput();
         subGrid2_Rows = (short)(Grid2_PageSize21) ;
         RF113( ) ;
         enableOutput();
         context.GX_webresponse.AddString(Grid2Container.ToJavascriptSource());
         /* End function gxgrGrid2_refresh */
      }

      protected void gxgrGrid1_refresh( SdtContext AV5Context )
      {
         GxWebStd.set_html_headers( context, 0, "", "");
         disableOutput();
         RF112( ) ;
         enableOutput();
         context.GX_webresponse.AddString(Grid1Container.ToJavascriptSource());
         /* End function gxgrGrid1_refresh */
      }

      protected void Refresh( )
      {
         RF112( ) ;
         /* End function Refresh */
      }

      protected void RF112( )
      {
         Grid1Container.PageSize = subGrid1_Recordsperpage( ) ;
         wbStart = 6 ;
         nGXsfl_6_idx = 1 ;
         sGXsfl_6_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_6_idx), 4, 0)), 4, "0") ;
         lblTextblock1_Internalname = "TEXTBLOCK1_"+sGXsfl_6_idx ;
         edtCursoId_Internalname = "CURSOID_"+sGXsfl_6_idx ;
         edtCursoNombre_Internalname = "CURSONOMBRE_"+sGXsfl_6_idx ;
         edtCursoDescripcion_Internalname = "CURSODESCRIPCION_"+sGXsfl_6_idx ;
         subGrid2_Internalname = "GRID2_"+sGXsfl_6_idx ;
         if ( String.IsNullOrEmpty(StringUtil.RTrim( context.wjLoc)) && ( context.nUserReturn != 1 ) )
         {
            /* Using cursor H00112 */
            pr_default.execute(0, new Object[] {AV5Context.gxTpr_Profesorid});
            while ( (pr_default.getStatus(0) != 101) )
            {
               A25CursoId = H00112_A25CursoId[0] ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A25CursoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A25CursoId), 4, 0)));
               A18ProfesorId = H00112_A18ProfesorId[0] ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A18ProfesorId", StringUtil.LTrim( StringUtil.Str( (decimal)(A18ProfesorId), 4, 0)));
               A29CursoDescripcion = H00112_A29CursoDescripcion[0] ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A29CursoDescripcion", A29CursoDescripcion);
               A26CursoNombre = H00112_A26CursoNombre[0] ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A26CursoNombre", A26CursoNombre);
               A19ProfesorApellidos = H00112_A19ProfesorApellidos[0] ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A19ProfesorApellidos", A19ProfesorApellidos);
               A20ProfesorNombre = H00112_A20ProfesorNombre[0] ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A20ProfesorNombre", A20ProfesorNombre);
               A29CursoDescripcion = H00112_A29CursoDescripcion[0] ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A29CursoDescripcion", A29CursoDescripcion);
               A26CursoNombre = H00112_A26CursoNombre[0] ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A26CursoNombre", A26CursoNombre);
               A19ProfesorApellidos = H00112_A19ProfesorApellidos[0] ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A19ProfesorApellidos", A19ProfesorApellidos);
               A20ProfesorNombre = H00112_A20ProfesorNombre[0] ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A20ProfesorNombre", A20ProfesorNombre);
               A21ProfesorNombreCompleto = A20ProfesorNombre + " " + A19ProfesorApellidos ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A21ProfesorNombreCompleto", A21ProfesorNombreCompleto);
               /* Execute user event: E11112 */
               E11112 ();
               pr_default.readNext(0);
            }
            pr_default.close(0);
            wbEnd = 6 ;
            WB110( ) ;
         }
      }

      protected int subGrid1_Pagecount( )
      {
         return (int)(-1) ;
      }

      protected int subGrid1_Recordcount( )
      {
         return (int)(-1) ;
      }

      protected int subGrid1_Recordsperpage( )
      {
         return (int)(-1) ;
      }

      protected int subGrid1_Currentpage( )
      {
         return (int)(-1) ;
      }

      protected void RF113( )
      {
         Grid2Container.PageSize = subGrid2_Recordsperpage( ) ;
         wbStart = 21 ;
         nGXsfl_21_idx = 1 ;
         sGXsfl_21_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_21_idx), 4, 0)), 4, "0") + sGXsfl_6_idx ;
         edtAlumnoId_Internalname = "ALUMNOID_"+sGXsfl_21_idx ;
         edtAlumnoNombreCompleto_Internalname = "ALUMNONOMBRECOMPLETO_"+sGXsfl_21_idx ;
         edtAlumnoEmail_Internalname = "ALUMNOEMAIL_"+sGXsfl_21_idx ;
         if ( String.IsNullOrEmpty(StringUtil.RTrim( context.wjLoc)) && ( context.nUserReturn != 1 ) )
         {
            /* Using cursor H00113 */
            pr_default.execute(1, new Object[] {A25CursoId});
            nGXsfl_21_idx = 1 ;
            GRID2_nEOF = 0 ;
            while ( ( (pr_default.getStatus(1) != 101) ) && ( ( ( 6 == 0 ) || ( GRID2_nCurrentRecord < GRID2_nFirstRecordOnPage + subGrid2_Recordsperpage( ) ) ) ) )
            {
               A30AlumnoEmail = H00113_A30AlumnoEmail[0] ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A30AlumnoEmail", A30AlumnoEmail);
               n30AlumnoEmail = H00113_n30AlumnoEmail[0] ;
               A1AlumnoId = H00113_A1AlumnoId[0] ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A1AlumnoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A1AlumnoId), 4, 0)));
               A3AlumnoApellidos = H00113_A3AlumnoApellidos[0] ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A3AlumnoApellidos", A3AlumnoApellidos);
               A2AlumnoNombre = H00113_A2AlumnoNombre[0] ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A2AlumnoNombre", A2AlumnoNombre);
               A30AlumnoEmail = H00113_A30AlumnoEmail[0] ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A30AlumnoEmail", A30AlumnoEmail);
               n30AlumnoEmail = H00113_n30AlumnoEmail[0] ;
               A3AlumnoApellidos = H00113_A3AlumnoApellidos[0] ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A3AlumnoApellidos", A3AlumnoApellidos);
               A2AlumnoNombre = H00113_A2AlumnoNombre[0] ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A2AlumnoNombre", A2AlumnoNombre);
               A4AlumnoNombreCompleto = A2AlumnoNombre + " " + A3AlumnoApellidos ;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A4AlumnoNombreCompleto", A4AlumnoNombreCompleto);
               /* Execute user event: E13113 */
               E13113 ();
               pr_default.readNext(1);
            }
            GRID2_nEOF = (short)(((pr_default.getStatus(1) == 101) ? 1 : 0)) ;
            pr_default.close(1);
            wbEnd = 21 ;
            WB110( ) ;
         }
      }

      protected int subGrid2_Pagecount( )
      {
         GRID2_nRecordCount = subGrid2_Recordcount( ) ;
         if ( ((int)(GRID2_nRecordCount) % (subGrid2_Recordsperpage( ))) == 0 )
         {
            return (int)(NumberUtil.Int( (long)(GRID2_nRecordCount/ (decimal)(subGrid2_Recordsperpage( ))))) ;
         }
         return (int)(NumberUtil.Int( (long)(GRID2_nRecordCount/ (decimal)(subGrid2_Recordsperpage( ))))+1) ;
      }

      protected int subGrid2_Recordcount( )
      {
         /* Using cursor H00114 */
         pr_default.execute(2, new Object[] {A25CursoId});
         GRID2_nRecordCount = H00114_AGRID2_nRecordCount[0] ;
         pr_default.close(2);
         return GRID2_nRecordCount ;
      }

      protected int subGrid2_Recordsperpage( )
      {
         if ( 6 > 0 )
         {
            if ( 1 > 0 )
            {
               return (int)(6*1) ;
            }
            else
            {
               return (int)(6) ;
            }
         }
         return (int)(-1) ;
      }

      protected int subGrid2_Currentpage( )
      {
         return (int)(NumberUtil.Int( (long)(GRID2_nFirstRecordOnPage/ (decimal)(subGrid2_Recordsperpage( ))))+1) ;
      }

      protected short subgrid2_firstpage( )
      {
         GRID2_nFirstRecordOnPage = 0 ;
         return 0 ;
      }

      protected short subgrid2_nextpage( )
      {
         GRID2_nRecordCount = subGrid2_Recordcount( ) ;
         if ( ( GRID2_nRecordCount >= subGrid2_Recordsperpage( ) ) && ( GRID2_nEOF == 0 ) )
         {
            GRID2_nFirstRecordOnPage = (int)(GRID2_nFirstRecordOnPage+subGrid2_Recordsperpage( )) ;
         }
         else
         {
            return 2 ;
         }
         return 0 ;
      }

      protected short subgrid2_previouspage( )
      {
         if ( GRID2_nFirstRecordOnPage >= subGrid2_Recordsperpage( ) )
         {
            GRID2_nFirstRecordOnPage = (int)(GRID2_nFirstRecordOnPage-subGrid2_Recordsperpage( )) ;
         }
         else
         {
            return 2 ;
         }
         return 0 ;
      }

      protected short subgrid2_lastpage( )
      {
         GRID2_nRecordCount = subGrid2_Recordcount( ) ;
         if ( GRID2_nRecordCount > subGrid2_Recordsperpage( ) )
         {
            if ( ((int)(GRID2_nRecordCount) % (subGrid2_Recordsperpage( ))) == 0 )
            {
               GRID2_nFirstRecordOnPage = (int)(GRID2_nRecordCount-subGrid2_Recordsperpage( )) ;
            }
            else
            {
               GRID2_nFirstRecordOnPage = (int)(GRID2_nRecordCount-((int)(GRID2_nRecordCount) % (subGrid2_Recordsperpage( )))) ;
            }
         }
         else
         {
            GRID2_nFirstRecordOnPage = 0 ;
         }
         return 0 ;
      }

      protected int subgrid2_gotopage( int nPageNo )
      {
         if ( nPageNo > 0 )
         {
            if ( nPageNo <= subGrid2_Pagecount( ) )
            {
               GRID2_nFirstRecordOnPage = (int)(subGrid2_Recordsperpage( )*(nPageNo-1)) ;
            }
            else
            {
               GRID2_nFirstRecordOnPage = (int)(subGrid2_Recordsperpage( )*(subGrid2_Pagecount( )-1)) ;
            }
         }
         else
         {
            GRID2_nFirstRecordOnPage = 0 ;
         }
         return (int)(0) ;
      }

      protected void STRUP110( )
      {
         /* Before Start, stand alone formulas. */
         context.Gx_err = 0 ;
         /* Execute Start event if defined. */
         context.wbGlbDoneStart = 0 ;
         /* Execute user event: E12112 */
         E12112 ();
         context.wbGlbDoneStart = 1 ;
         /* After Start, stand alone formulas. */
         if ( StringUtil.StrCmp(context.GetRequestMethod( ), "POST") == 0 )
         {
            /* Read saved SDTs. */
            /* Read variables values. */
            A21ProfesorNombreCompleto = cgiGet( edtProfesorNombreCompleto_Internalname) ;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A21ProfesorNombreCompleto", A21ProfesorNombreCompleto);
            /* Read saved values. */
            nRC_Grid1 = (short)(context.localUtil.CToN( cgiGet( "nRC_Grid1"), ",", ".")) ;
            /* Read subfile selected row values. */
            /* Read hidden variables. */
         }
         else
         {
            dynload_actions( ) ;
         }
      }

      private void E11112( )
      {
         /* Grid1_Load Routine */
         edtCursoId_Visible = 0 ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtCursoId_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(edtCursoId_Visible), 5, 0)));
         edtCursoNombre_Link = formatLink("viewcurso.aspx") + "?" + UrlEncode("" +A25CursoId) + "," + UrlEncode(StringUtil.RTrim("General")) ;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtCursoNombre_Internalname, "Link", edtCursoNombre_Link);
         /* Load Method */
         if ( wbStart != -1 )
         {
            wbStart = 6 ;
         }
         sendrow_62( ) ;
      }

      protected void GXStart( )
      {
         /* Execute user event: E12112 */
         E12112 ();
         if ( returnInSub )
         {
            returnInSub = true;
            if (true) return;
         }
      }

      protected void E12112( )
      {
         /* Start Routine */
         new loadcontext(context ).execute( out  AV5Context) ;
      }

      private void E13113( )
      {
         /* Grid2_Load Routine */
         /* Load Method */
         if ( wbStart != -1 )
         {
            wbStart = 21 ;
         }
         if ( StringUtil.StrCmp(context.GetRequestMethod( ), "POST") == 0 )
         {
            GXCCtl = "GRID2_nFirstRecordOnPage_" + sGXsfl_6_idx ;
            GRID2_nFirstRecordOnPage = (int)(context.localUtil.CToN( cgiGet( GXCCtl), ",", ".")) ;
         }
         else
         {
            GRID2_nFirstRecordOnPage = 0 ;
         }
         if ( ( subGrid2_Islastpage == 1 ) || ( 6 == 0 ) || ( ( GRID2_nCurrentRecord >= GRID2_nFirstRecordOnPage ) && ( GRID2_nCurrentRecord < GRID2_nFirstRecordOnPage + subGrid2_Recordsperpage( ) ) ) )
         {
            sendrow_213( ) ;
         }
         GRID2_nCurrentRecord = (int)(GRID2_nCurrentRecord+1) ;
      }

      public override void setparameters( Object[] obj )
      {
         createObjects();
         initialize();
      }

      public override String getresponse( String sGXDynURL )
      {
         initialize_properties( ) ;
         BackMsgLst = context.GX_msglist ;
         context.GX_msglist = LclMsgLst ;
         sDynURL = sGXDynURL ;
         nGotPars = (short)(1) ;
         nGXWrapped = (short)(1) ;
         context.SetWrapped(true);
         PA112( ) ;
         WS112( ) ;
         WE112( ) ;
         this.cleanup();
         context.SetWrapped(false);
         context.GX_msglist = BackMsgLst ;
         return "";
      }

      public void responsestatic( String sGXDynURL )
      {
      }

      protected void define_styles( )
      {
         AddThemeStyleSheetFile("", "Fantastic.css", "?13213976");
         idxLst = 1 ;
         while ( idxLst <= Form.Jscriptsrc.Count )
         {
            context.AddJavascriptSource(StringUtil.RTrim( Form.Jscriptsrc.Item(idxLst)), "?13381973");
            idxLst = (int)(idxLst+1) ;
         }
         /* End function define_styles */
      }

      protected void include_jscripts( )
      {
         if ( nGXWrapped != 1 )
         {
            context.AddJavascriptSource("messages.spa.js", "?40140");
            context.AddJavascriptSource("wpprincipal.js", "?13381973");
         }
         /* End function include_jscripts */
      }

      protected void sendrow_213( )
      {
         WB110( ) ;
         if ( ( 6 * 1 == 0 ) || ( nGXsfl_21_idx <= subGrid2_Recordsperpage( ) * 1 ) )
         {
            Grid2Row = GXWebRow.GetNew(context,Grid2Container) ;
            if ( subGrid2_Backcolorstyle == 0 )
            {
               /* None style subfile background logic. */
               subGrid2_Backstyle = 0 ;
               if ( StringUtil.StrCmp(subGrid2_Class, "") != 0 )
               {
                  subGrid2_Linesclass = subGrid2_Class+"Odd" ;
               }
            }
            else if ( subGrid2_Backcolorstyle == 1 )
            {
               /* Uniform style subfile background logic. */
               subGrid2_Backstyle = 0 ;
               subGrid2_Backcolor = subGrid2_Allbackcolor ;
               context.httpAjaxContext.ajax_rsp_assign_prop("", false, "Grid2ContainerDiv", "Backcolor", StringUtil.LTrim( StringUtil.Str( (decimal)(subGrid2_Backcolor), 9, 0)));
               if ( StringUtil.StrCmp(subGrid2_Class, "") != 0 )
               {
                  subGrid2_Linesclass = subGrid2_Class+"Uniform" ;
               }
            }
            else if ( subGrid2_Backcolorstyle == 2 )
            {
               /* Header style subfile background logic. */
               subGrid2_Backstyle = 1 ;
               if ( StringUtil.StrCmp(subGrid2_Class, "") != 0 )
               {
                  subGrid2_Linesclass = subGrid2_Class+"Odd" ;
               }
               subGrid2_Backcolor = (int)(0xD3D4D3) ;
               context.httpAjaxContext.ajax_rsp_assign_prop("", false, "Grid2ContainerDiv", "Backcolor", StringUtil.LTrim( StringUtil.Str( (decimal)(subGrid2_Backcolor), 9, 0)));
            }
            else if ( subGrid2_Backcolorstyle == 3 )
            {
               /* Report style subfile background logic. */
               subGrid2_Backstyle = 1 ;
               if ( ((int)(nGXsfl_21_idx) % (2)) == 0 )
               {
                  subGrid2_Backcolor = (int)(0xFFFFFF) ;
                  context.httpAjaxContext.ajax_rsp_assign_prop("", false, "Grid2ContainerDiv", "Backcolor", StringUtil.LTrim( StringUtil.Str( (decimal)(subGrid2_Backcolor), 9, 0)));
                  if ( StringUtil.StrCmp(subGrid2_Class, "") != 0 )
                  {
                     subGrid2_Linesclass = subGrid2_Class+"Even" ;
                  }
               }
               else
               {
                  subGrid2_Backcolor = (int)(0xD3D4D3) ;
                  context.httpAjaxContext.ajax_rsp_assign_prop("", false, "Grid2ContainerDiv", "Backcolor", StringUtil.LTrim( StringUtil.Str( (decimal)(subGrid2_Backcolor), 9, 0)));
                  if ( StringUtil.StrCmp(subGrid2_Class, "") != 0 )
                  {
                     subGrid2_Linesclass = subGrid2_Class+"Odd" ;
                  }
               }
            }
            if ( Grid2Container.GetWrapped() == 1 )
            {
               context.WriteHtmlText( "<tr ") ;
               context.WriteHtmlText( " class=\""+subGrid2_Linesclass+"\" style=\""+""+"\"") ;
               context.WriteHtmlText( ">") ;
            }
            /* Subfile cell */
            if ( Grid2Container.GetWrapped() == 1 )
            {
               context.WriteHtmlText( "<td valign=\"middle\" align=\""+"right"+"\""+" style=\""+((-1==0) ? "display:none;" : "")+"\">") ;
            }
            /* Single line edit */
            ClassString = "Attribute" ;
            StyleString = "" ;
            ROClassString = ClassString ;
            Grid2Row.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtAlumnoId_Internalname,StringUtil.LTrim( StringUtil.NToC( (decimal)(A1AlumnoId), 4, 0, ",", "")),(String)"",(short)0,(String)"px",(short)17,(String)"",(short)4,(short)-1,(short)0,(short)0,(short)0,(short)0,(String)"",(String)"",(String)StyleString,(String)ClassString,(String)ROClassString,context.localUtil.Format( (decimal)(A1AlumnoId), "ZZZ9"),(String)"",(short)0,(String)edtAlumnoId_Jsonclick,(String)"",(short)21,(short)1,(short)1,(bool)false,(String)"right"});
            /* Subfile cell */
            if ( Grid2Container.GetWrapped() == 1 )
            {
               context.WriteHtmlText( "<td valign=\"middle\" align=\""+"left"+"\""+" style=\""+((-1==0) ? "display:none;" : "")+"\">") ;
            }
            /* Single line edit */
            ClassString = "Attribute" ;
            StyleString = "" ;
            ROClassString = ClassString ;
            Grid2Row.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtAlumnoNombreCompleto_Internalname,StringUtil.RTrim( A4AlumnoNombreCompleto),(String)"",(short)0,(String)"px",(short)17,(String)"",(short)220,(short)-1,(short)0,(short)0,(short)0,(short)0,(String)"",(String)"",(String)StyleString,(String)ClassString,(String)ROClassString,StringUtil.RTrim( context.localUtil.Format( A4AlumnoNombreCompleto, "")),(String)"",(short)0,(String)edtAlumnoNombreCompleto_Jsonclick,(String)"",(short)21,(short)1,(short)1,(bool)false,(String)"left"});
            /* Subfile cell */
            if ( Grid2Container.GetWrapped() == 1 )
            {
               context.WriteHtmlText( "<td valign=\"middle\" align=\""+"left"+"\""+" style=\""+((-1==0) ? "display:none;" : "")+"\">") ;
            }
            /* Single line edit */
            ClassString = "Attribute" ;
            StyleString = "" ;
            ROClassString = ClassString ;
            Grid2Row.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtAlumnoEmail_Internalname,StringUtil.RTrim( A30AlumnoEmail),(String)"",(short)0,(String)"px",(short)17,(String)"",(short)75,(short)-1,(short)0,(short)0,(short)0,(short)0,(String)"",(String)"",(String)StyleString,(String)ClassString,(String)ROClassString,StringUtil.RTrim( context.localUtil.Format( A30AlumnoEmail, "")),(String)"",(short)0,(String)edtAlumnoEmail_Jsonclick,(String)"",(short)21,(short)1,(short)1,(bool)false,(String)"left"});
            Grid2Container.AddRow(Grid2Row);
            nGXsfl_21_idx = (short)(((subGrid2_Islastpage==1)&&(nGXsfl_21_idx+1>subGrid2_Recordsperpage( )) ? 1 : nGXsfl_21_idx+1)) ;
            sGXsfl_21_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_21_idx), 4, 0)), 4, "0") + sGXsfl_6_idx ;
            edtAlumnoId_Internalname = "ALUMNOID_"+sGXsfl_21_idx ;
            edtAlumnoNombreCompleto_Internalname = "ALUMNONOMBRECOMPLETO_"+sGXsfl_21_idx ;
            edtAlumnoEmail_Internalname = "ALUMNOEMAIL_"+sGXsfl_21_idx ;
         }
         /* End function sendrow_213 */
      }

      protected void sendrow_62( )
      {
         WB110( ) ;
         Grid1Row = GXWebRow.GetNew(context,Grid1Container) ;
         if ( subGrid1_Backcolorstyle == 0 )
         {
            /* None style subfile background logic. */
            subGrid1_Backstyle = 0 ;
            if ( StringUtil.StrCmp(subGrid1_Class, "") != 0 )
            {
               subGrid1_Linesclass = subGrid1_Class+"Odd" ;
            }
         }
         else if ( subGrid1_Backcolorstyle == 1 )
         {
            /* Uniform style subfile background logic. */
            subGrid1_Backstyle = 0 ;
            subGrid1_Backcolor = subGrid1_Allbackcolor ;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, "Grid1ContainerDiv", "Backcolor", StringUtil.LTrim( StringUtil.Str( (decimal)(subGrid1_Backcolor), 9, 0)));
            if ( StringUtil.StrCmp(subGrid1_Class, "") != 0 )
            {
               subGrid1_Linesclass = subGrid1_Class+"Uniform" ;
            }
         }
         else if ( subGrid1_Backcolorstyle == 2 )
         {
            /* Header style subfile background logic. */
            subGrid1_Backstyle = 1 ;
            if ( StringUtil.StrCmp(subGrid1_Class, "") != 0 )
            {
               subGrid1_Linesclass = subGrid1_Class+"Odd" ;
            }
            subGrid1_Backcolor = (int)(0xFFFFFF) ;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, "Grid1ContainerDiv", "Backcolor", StringUtil.LTrim( StringUtil.Str( (decimal)(subGrid1_Backcolor), 9, 0)));
         }
         else if ( subGrid1_Backcolorstyle == 3 )
         {
            /* Report style subfile background logic. */
            subGrid1_Backstyle = 1 ;
            if ( ((int)(nGXsfl_6_idx/ (decimal)(4)) % (2)) == 0 )
            {
               subGrid1_Backcolor = (int)(0x0) ;
               context.httpAjaxContext.ajax_rsp_assign_prop("", false, "Grid1ContainerDiv", "Backcolor", StringUtil.LTrim( StringUtil.Str( (decimal)(subGrid1_Backcolor), 9, 0)));
               if ( StringUtil.StrCmp(subGrid1_Class, "") != 0 )
               {
                  subGrid1_Linesclass = subGrid1_Class+"Even" ;
               }
            }
            else
            {
               subGrid1_Backcolor = (int)(0xFFFFFF) ;
               context.httpAjaxContext.ajax_rsp_assign_prop("", false, "Grid1ContainerDiv", "Backcolor", StringUtil.LTrim( StringUtil.Str( (decimal)(subGrid1_Backcolor), 9, 0)));
               if ( StringUtil.StrCmp(subGrid1_Class, "") != 0 )
               {
                  subGrid1_Linesclass = subGrid1_Class+"Odd" ;
               }
            }
         }
         /* Start of Columns property logic. */
         if ( Grid1Container.GetWrapped() == 1 )
         {
            if ( ( 4 == 0 ) && ( nGXsfl_6_idx == 1 ) )
            {
               context.WriteHtmlText( "<tr"+" class=\""+subGrid1_Linesclass+"\" style=\""+""+"\""+">") ;
            }
            if ( 4 > 0 )
            {
               if ( ( 4 == 1 ) || ( ((int)(nGXsfl_6_idx) % (4)) - 1 == 0 ) )
               {
                  context.WriteHtmlText( "<tr"+" class=\""+subGrid1_Linesclass+"\" style=\""+""+"\""+">") ;
               }
            }
         }
         Grid1Row.AddColumnProperties("row", -1, isAjaxCallMode( ), new Object[] {(String)"",(String)subGrid1_Linesclass,(String)""});
         Grid1Row.AddColumnProperties("cell", -1, isAjaxCallMode( ), new Object[] {(String)"",(String)""});
         /* Table start */
         Grid1Row.AddColumnProperties("table", -1, isAjaxCallMode( ), new Object[] {(String)tblTable2_Internalname+"_"+sGXsfl_6_idx,(short)1,(String)"Table",(String)"",(int)(0xFAF0E6),(int)(0x800000),(String)"",(String)"",(short)1,(short)1,(short)2,(String)"",(String)"",(String)"",(String)"px",(String)"px"});
         Grid1Row.AddColumnProperties("row", -1, isAjaxCallMode( ), new Object[] {(String)"",(String)"",(String)""});
         Grid1Row.AddColumnProperties("cell", -1, isAjaxCallMode( ), new Object[] {(String)"",(String)""});
         /* Table start */
         Grid1Row.AddColumnProperties("table", -1, isAjaxCallMode( ), new Object[] {(String)tblTable1_Internalname+"_"+sGXsfl_6_idx,(short)1,(String)"Table",(String)"",(String)"",(int)(0x800000),(String)"",(String)"",(short)0,(short)1,(short)2,(String)"",(String)"",(String)"",(String)"px",(String)"px"});
         Grid1Row.AddColumnProperties("row", -1, isAjaxCallMode( ), new Object[] {(String)"",(String)"",(String)""});
         Grid1Row.AddColumnProperties("cell", -1, isAjaxCallMode( ), new Object[] {(String)"",(String)""});
         /* Text block */
         ClassString = "MedianoMarron" ;
         StyleString = "" ;
         Grid1Row.AddColumnProperties("label", 4, isAjaxCallMode( ), new Object[] {(String)lblTextblock1_Internalname,(short)1,(short)1,(short)0,(String)"Curso:",(String)"",(String)"",(String)"",(short)0,(String)lblTextblock1_Jsonclick,(String)"",(String)StyleString,(String)ClassString});
         /* Single line edit */
         ClassString = "Attribute" ;
         StyleString = "" ;
         ROClassString = ClassString ;
         Grid1Row.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtCursoId_Internalname,StringUtil.LTrim( StringUtil.NToC( (decimal)(A25CursoId), 4, 0, ",", "")),(String)"",(short)4,(String)"chr",(short)1,(String)"row",(short)4,(int)edtCursoId_Visible,(short)0,(short)0,(short)0,(short)0,(String)"",(String)"",(String)StyleString,(String)ClassString,(String)ROClassString,context.localUtil.Format( (decimal)(A25CursoId), "ZZZ9"),(String)"",(short)0,(String)edtCursoId_Jsonclick,(String)"",(short)6,(short)1,(short)1,(bool)true,(String)"right"});
         /* Single line edit */
         ClassString = "Attribute" ;
         StyleString = "" ;
         ROClassString = ClassString ;
         Grid1Row.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtCursoNombre_Internalname,StringUtil.RTrim( A26CursoNombre),(String)"",(short)5,(String)"chr",(short)1,(String)"row",(short)5,(short)1,(short)0,(short)0,(short)0,(short)0,(String)edtCursoNombre_Link,(String)"",(String)StyleString,(String)ClassString,(String)ROClassString,StringUtil.RTrim( context.localUtil.Format( A26CursoNombre, "")),(String)"",(short)0,(String)edtCursoNombre_Jsonclick,(String)"",(short)6,(short)1,(short)1,(bool)true,(String)"left"});
         /* Multiple line edit */
         ClassString = "Attribute" ;
         StyleString = "" ;
         ClassString = "Attribute" ;
         StyleString = "" ;
         Grid1Row.AddColumnProperties("html_textarea", 1, isAjaxCallMode( ), new Object[] {(String)edtCursoDescripcion_Internalname,StringUtil.RTrim( A29CursoDescripcion),(short)1,(short)0,(short)0,(short)80,(String)"chr",(short)9,(String)"row",(String)StyleString,(String)ClassString,(String)"650",(String)"",(short)-1,(short)0,(String)"",(String)"",(bool)true});
         if ( Grid1Container.GetWrapped() == 1 )
         {
            Grid1Container.CloseTag("cell");
         }
         if ( Grid1Container.GetWrapped() == 1 )
         {
            Grid1Container.CloseTag("row");
         }
         Grid1Row.AddColumnProperties("row", -1, isAjaxCallMode( ), new Object[] {(String)"",(String)"",(String)""});
         Grid1Row.AddColumnProperties("cell", -1, isAjaxCallMode( ), new Object[] {(String)"",(String)""+" style=\"height:16px\""});
         /*  Child Grid Control  */
         Grid1Row.AddColumnProperties("subfile", -1, isAjaxCallMode( ), new Object[] {(String)"Grid2Container"});
         Grid2Container.Clear();
         Grid2Container.SetWrapped(nGXWrapped);
         if ( Grid2Container.GetWrapped() == 1 )
         {
            sStyleString = "" ;
            sStyleString = sStyleString + " width: " + StringUtil.LTrim( StringUtil.Str( (decimal)(350), 10, 0)) + "px" + ";" ;
            GxWebStd.gx_table_start( context, subGrid2_Internalname, subGrid2_Internalname, "", "WorkWith", 0, "", "", 1, 2, sStyleString, "", 0);
            /* Subfile titles */
            context.WriteHtmlText( "<tr") ;
            context.WriteHtmlTextNl( ">") ;
            if ( subGrid2_Backcolorstyle == 0 )
            {
               subGrid2_Titlebackstyle = 0 ;
               if ( StringUtil.Len( subGrid2_Class) > 0 )
               {
                  subGrid2_Linesclass = subGrid2_Class+"Title" ;
               }
            }
            else
            {
               subGrid2_Titlebackstyle = 1 ;
               if ( subGrid2_Backcolorstyle == 1 )
               {
                  subGrid2_Titlebackcolor = subGrid2_Allbackcolor ;
                  if ( StringUtil.Len( subGrid2_Class) > 0 )
                  {
                     subGrid2_Linesclass = subGrid2_Class+"UniformTitle" ;
                  }
               }
               else
               {
                  if ( StringUtil.Len( subGrid2_Class) > 0 )
                  {
                     subGrid2_Linesclass = subGrid2_Class+"Title" ;
                  }
               }
            }
            context.WriteHtmlText( "<th align=\""+"right"+"\" "+" nowrap=\"nowrap\" "+" class=\""+subGrid2_Linesclass+"\" "+" style=\""+((-1==0) ? "display:none;" : "")+""+"\" "+">") ;
            context.SendWebValue( "Id") ;
            context.WriteHtmlTextNl( "</th>") ;
            context.WriteHtmlText( "<th align=\""+"left"+"\" "+" nowrap=\"nowrap\" "+" class=\""+subGrid2_Linesclass+"\" "+" style=\""+((-1==0) ? "display:none;" : "")+""+"\" "+">") ;
            context.SendWebValue( "Alumno") ;
            context.WriteHtmlTextNl( "</th>") ;
            context.WriteHtmlText( "<th align=\""+"left"+"\" "+" nowrap=\"nowrap\" "+" class=\""+subGrid2_Linesclass+"\" "+" style=\""+((-1==0) ? "display:none;" : "")+""+"\" "+">") ;
            context.SendWebValue( "Email") ;
            context.WriteHtmlTextNl( "</th>") ;
            context.WriteHtmlTextNl( "</tr>") ;
         }
         else
         {
            Grid2Container.Clear();
            Grid2Container.SetWrapped(nGXWrapped);
            Grid2Container.AddObjectProperty("GridName", "Grid2");
            Grid2Container.AddObjectProperty("Class", "WorkWith");
            Grid2Container.AddObjectProperty("Cellpadding", StringUtil.LTrim( StringUtil.NToC( (decimal)(1), 4, 0, ".", "")));
            Grid2Container.AddObjectProperty("Cellspacing", StringUtil.LTrim( StringUtil.NToC( (decimal)(2), 4, 0, ".", "")));
            Grid2Container.AddObjectProperty("Backcolorstyle", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGrid2_Backcolorstyle), 1, 0, ".", "")));
            Grid2Container.AddObjectProperty("Width", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGrid2_Width), 9, 0, ".", "")));
            Grid2Container.AddObjectProperty("CmpContext", "");
            Grid2Container.AddObjectProperty("InMasterPage", "false");
            Grid2Column = GXWebColumn.GetNew(isAjaxCallMode( )) ;
            Grid2Column.AddObjectProperty("Value", StringUtil.LTrim( StringUtil.NToC( (decimal)(A1AlumnoId), 4, 0, ".", "")));
            Grid2Container.AddColumnProperties(Grid2Column);
            Grid2Column = GXWebColumn.GetNew(isAjaxCallMode( )) ;
            Grid2Column.AddObjectProperty("Value", StringUtil.RTrim( A4AlumnoNombreCompleto));
            Grid2Container.AddColumnProperties(Grid2Column);
            Grid2Column = GXWebColumn.GetNew(isAjaxCallMode( )) ;
            Grid2Column.AddObjectProperty("Value", StringUtil.RTrim( A30AlumnoEmail));
            Grid2Container.AddColumnProperties(Grid2Column);
            Grid2Container.AddObjectProperty("Allowselection", "false");
            Grid2Container.AddObjectProperty("Allowcollapsing", "false");
            Grid2Container.AddObjectProperty("Collapsed", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGrid2_Collapsed), 9, 0, ".", "")));
         }
         RF113( ) ;
         nRC_Grid2 = (short)(nGXsfl_21_idx-1) ;
         GXCCtl = "nRC_Grid2_" + sGXsfl_6_idx ;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.LTrim( StringUtil.NToC( (decimal)(nRC_Grid2), 4, 0, ",", "")));
         if ( Grid2Container.GetWrapped() == 1 )
         {
            context.WriteHtmlText( "</table>") ;
         }
         else
         {
            Grid2Container.AddObjectProperty("GRID2_nEOF", GRID2_nEOF);
            Grid2Container.AddObjectProperty("GRID2_nFirstRecordOnPage", GRID2_nFirstRecordOnPage);
            GxWebStd.gx_hidden_field( context, "Grid2ContainerData"+"_"+sGXsfl_6_idx, Grid2Container.ToJavascriptSource());
            if ( isAjaxCallMode( ) )
            {
               Grid1Row.AddGrid("Grid2", Grid2Container);
            }
            if ( context.isAjaxRequest( ) )
            {
               GxWebStd.gx_hidden_field( context, "Grid2ContainerData"+"V_"+sGXsfl_6_idx, Grid2Container.GridValuesHidden());
            }
            else
            {
               context.WriteHtmlText( "<input type=\"hidden\" "+"name=\""+"Grid2ContainerData"+"V_"+sGXsfl_6_idx+"\" value='"+Grid2Container.GridValuesHidden()+"'>") ;
            }
         }
         if ( Grid1Container.GetWrapped() == 1 )
         {
            Grid1Container.CloseTag("cell");
         }
         if ( Grid1Container.GetWrapped() == 1 )
         {
            Grid1Container.CloseTag("row");
         }
         if ( Grid1Container.GetWrapped() == 1 )
         {
            Grid1Container.CloseTag("table");
         }
         /* End of table */
         if ( Grid1Container.GetWrapped() == 1 )
         {
            Grid1Container.CloseTag("cell");
         }
         if ( Grid1Container.GetWrapped() == 1 )
         {
            Grid1Container.CloseTag("row");
         }
         if ( Grid1Container.GetWrapped() == 1 )
         {
            Grid1Container.CloseTag("table");
         }
         /* End of table */
         if ( Grid1Container.GetWrapped() == 1 )
         {
            Grid1Container.CloseTag("cell");
         }
         if ( Grid1Container.GetWrapped() == 1 )
         {
            Grid1Container.CloseTag("row");
         }
         GXCCtl = "GRID2_nFirstRecordOnPage_" + sGXsfl_6_idx ;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.LTrim( StringUtil.NToC( (decimal)(GRID2_nFirstRecordOnPage), 6, 0, ",", "")));
         GXCCtl = "GRID2_nEOF_" + sGXsfl_6_idx ;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.LTrim( StringUtil.NToC( (decimal)(GRID2_nEOF), 1, 0, ",", "")));
         GRID2_nFirstRecordOnPage = 0 ;
         GRID2_nCurrentRecord = 0 ;
         /* End of Columns property logic. */
         if ( Grid1Container.GetWrapped() == 1 )
         {
            if ( 4 > 0 )
            {
               if ( ((int)(nGXsfl_6_idx) % (4)) == 0 )
               {
                  context.WriteHtmlTextNl( "</tr>") ;
               }
            }
         }
         Grid1Container.AddRow(Grid1Row);
         nGXsfl_6_idx = (short)(((subGrid1_Islastpage==1)&&(nGXsfl_6_idx+1>subGrid1_Recordsperpage( )) ? 1 : nGXsfl_6_idx+1)) ;
         sGXsfl_6_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_6_idx), 4, 0)), 4, "0") ;
         lblTextblock1_Internalname = "TEXTBLOCK1_"+sGXsfl_6_idx ;
         edtCursoId_Internalname = "CURSOID_"+sGXsfl_6_idx ;
         edtCursoNombre_Internalname = "CURSONOMBRE_"+sGXsfl_6_idx ;
         edtCursoDescripcion_Internalname = "CURSODESCRIPCION_"+sGXsfl_6_idx ;
         subGrid2_Internalname = "GRID2_"+sGXsfl_6_idx ;
         /* End function sendrow_62 */
      }

      protected void init_default_properties( )
      {
         edtProfesorNombreCompleto_Internalname = "PROFESORNOMBRECOMPLETO" ;
         tblTable1_Internalname = "TABLE1" ;
         tblTable2_Internalname = "TABLE2" ;
         Form.Internalname = "FORM" ;
         subGrid2_Internalname = "GRID2_"+sGXsfl_6_idx ;
         subGrid1_Internalname = "GRID1" ;
      }

      public override void initialize_properties( )
      {
         init_default_properties( ) ;
         subGrid2_Width = 350 ;
         edtCursoNombre_Jsonclick = "" ;
         edtCursoId_Jsonclick = "" ;
         subGrid1_Class = "FreeStyleGrid" ;
         edtAlumnoEmail_Jsonclick = "" ;
         edtAlumnoNombreCompleto_Jsonclick = "" ;
         edtAlumnoId_Jsonclick = "" ;
         subGrid2_Class = "WorkWith" ;
         subGrid2_Backcolorstyle = 3 ;
         edtCursoNombre_Link = "" ;
         edtCursoId_Visible = 1 ;
         lblTextblock1_Caption = "Curso:" ;
         subGrid1_Bordercolor = (int)(0x800000) ;
         subGrid1_Borderwidth = 0 ;
         subGrid1_Backcolorstyle = 0 ;
         edtProfesorNombreCompleto_Jsonclick = "" ;
         Form.Headerrawhtml = "" ;
         Form.Background = "" ;
         Form.Backcolor = (int)(0xFFFFFF) ;
         Form.Caption = "WPPrincipal" ;
      }

      protected void cleanup( )
      {
         flushBuffer();
         CloseOpenCursors();
         if ( IsMain )
         {
            context.CloseConnections() ;
         }
      }

      protected void CloseOpenCursors( )
      {
      }

      public override void initialize( )
      {
         gxfirstwebparm = "" ;
         gxfirstwebparm_bkp = "" ;
         AV5Context = new SdtContext(context);
         sDynURL = "" ;
         FormProcess = "" ;
         A20ProfesorNombre = "" ;
         A19ProfesorApellidos = "" ;
         A2AlumnoNombre = "" ;
         A3AlumnoApellidos = "" ;
         GX_FocusControl = "" ;
         Form = new GXWebForm();
         sPrefix = "" ;
         ClassString = "" ;
         StyleString = "" ;
         A21ProfesorNombreCompleto = "" ;
         Grid1Container = new GXWebGrid( context);
         sStyleString = "" ;
         Grid1Column = new GXWebColumn();
         A26CursoNombre = "" ;
         A29CursoDescripcion = "" ;
         sEvt = "" ;
         EvtGridId = "" ;
         EvtRowId = "" ;
         sEvtType = "" ;
         lblTextblock1_Internalname = "" ;
         edtCursoId_Internalname = "" ;
         edtCursoNombre_Internalname = "" ;
         edtCursoDescripcion_Internalname = "" ;
         GXCCtl = "" ;
         edtAlumnoId_Internalname = "" ;
         edtAlumnoNombreCompleto_Internalname = "" ;
         edtAlumnoEmail_Internalname = "" ;
         A4AlumnoNombreCompleto = "" ;
         A30AlumnoEmail = "" ;
         Grid2Container = new GXWebGrid( context);
         scmdbuf = "" ;
         H00112_A25CursoId = new short[1] ;
         H00112_A18ProfesorId = new short[1] ;
         H00112_A29CursoDescripcion = new String[] {""} ;
         H00112_A26CursoNombre = new String[] {""} ;
         H00112_A19ProfesorApellidos = new String[] {""} ;
         H00112_A20ProfesorNombre = new String[] {""} ;
         H00113_A25CursoId = new short[1] ;
         H00113_A30AlumnoEmail = new String[] {""} ;
         H00113_n30AlumnoEmail = new bool[] {false} ;
         H00113_A1AlumnoId = new short[1] ;
         H00113_A3AlumnoApellidos = new String[] {""} ;
         H00113_A2AlumnoNombre = new String[] {""} ;
         H00114_AGRID2_nRecordCount = new int[1] ;
         BackMsgLst = new msglist();
         LclMsgLst = new msglist();
         Grid2Row = new GXWebRow();
         subGrid2_Linesclass = "" ;
         ROClassString = "" ;
         Grid1Row = new GXWebRow();
         subGrid1_Linesclass = "" ;
         lblTextblock1_Jsonclick = "" ;
         GXt_char2 = "" ;
         GXt_char1 = "" ;
         Grid2Column = new GXWebColumn();
         GXt_char3 = "" ;
         GXt_char4 = "" ;
         pr_default = new DataStoreProvider(context, new GeneXus.Programs.wpprincipal__default(),
            new Object[][] {
                new Object[] {
               H00112_A25CursoId, H00112_A18ProfesorId, H00112_A29CursoDescripcion, H00112_A26CursoNombre, H00112_A19ProfesorApellidos, H00112_A20ProfesorNombre
               }
               , new Object[] {
               H00113_A25CursoId, H00113_A30AlumnoEmail, H00113_n30AlumnoEmail, H00113_A1AlumnoId, H00113_A3AlumnoApellidos, H00113_A2AlumnoNombre
               }
               , new Object[] {
               H00114_AGRID2_nRecordCount
               }
            }
         );
         /* GeneXus formulas. */
         context.Gx_err = 0 ;
      }

      private short nGotPars ;
      private short GxWebError ;
      private short nRC_Grid2 ;
      private short nGXsfl_21_idx=1 ;
      private short A25CursoId ;
      private short nRC_Grid1 ;
      private short nGXsfl_6_idx=1 ;
      private short initialized ;
      private short gxajaxcallmode ;
      private short nGXWrapped ;
      private short wbEnd ;
      private short wbStart ;
      private short subGrid1_Backcolorstyle ;
      private short subGrid1_Borderwidth ;
      private short subGrid1_Collapsed ;
      private short GRID2_nEOF ;
      private short A1AlumnoId ;
      private short nDonePA ;
      private short subGrid2_Rows ;
      private short A18ProfesorId ;
      private short subGrid2_Backcolorstyle ;
      private short subGrid2_Backstyle ;
      private short subGrid1_Backstyle ;
      private short subGrid2_Titlebackstyle ;
      private short subGrid2_Collapsed ;
      private int Grid2_PageSize21 ;
      private int subGrid1_Bordercolor ;
      private int edtCursoId_Visible ;
      private int subGrid1_Selectioncolor ;
      private int subGrid1_Hoveringcolor ;
      private int GRID2_nFirstRecordOnPage ;
      private int subGrid1_Islastpage ;
      private int subGrid2_Islastpage ;
      private int GRID1_nFirstRecordOnPage ;
      private int GRID1_nCurrentRecord ;
      private int GRID2_nCurrentRecord ;
      private int GRID2_nRecordCount ;
      private int idxLst ;
      private int subGrid2_Backcolor ;
      private int subGrid2_Allbackcolor ;
      private int subGrid1_Backcolor ;
      private int subGrid1_Allbackcolor ;
      private int subGrid2_Titlebackcolor ;
      private int subGrid2_Width ;
      private String gxfirstwebparm ;
      private String gxfirstwebparm_bkp ;
      private String sGXsfl_21_idx="0001" ;
      private String sGXsfl_6_idx="0001" ;
      private String sDynURL ;
      private String FormProcess ;
      private String GX_FocusControl ;
      private String sPrefix ;
      private String ClassString ;
      private String StyleString ;
      private String edtProfesorNombreCompleto_Internalname ;
      private String edtProfesorNombreCompleto_Jsonclick ;
      private String sStyleString ;
      private String subGrid1_Internalname ;
      private String lblTextblock1_Caption ;
      private String edtCursoNombre_Link ;
      private String sEvt ;
      private String EvtGridId ;
      private String EvtRowId ;
      private String sEvtType ;
      private String lblTextblock1_Internalname ;
      private String edtCursoId_Internalname ;
      private String edtCursoNombre_Internalname ;
      private String edtCursoDescripcion_Internalname ;
      private String subGrid2_Internalname ;
      private String GXCCtl ;
      private String edtAlumnoId_Internalname ;
      private String edtAlumnoNombreCompleto_Internalname ;
      private String edtAlumnoEmail_Internalname ;
      private String scmdbuf ;
      private String subGrid2_Class ;
      private String subGrid2_Linesclass ;
      private String ROClassString ;
      private String edtAlumnoId_Jsonclick ;
      private String edtAlumnoNombreCompleto_Jsonclick ;
      private String edtAlumnoEmail_Jsonclick ;
      private String subGrid1_Class ;
      private String subGrid1_Linesclass ;
      private String tblTable2_Internalname ;
      private String tblTable1_Internalname ;
      private String lblTextblock1_Jsonclick ;
      private String edtCursoId_Jsonclick ;
      private String edtCursoNombre_Jsonclick ;
      private String GXt_char2 ;
      private String GXt_char1 ;
      private String GXt_char3 ;
      private String GXt_char4 ;
      private bool entryPointCalled ;
      private bool wbLoad ;
      private bool Rfr0gs ;
      private bool wbErr ;
      private bool n30AlumnoEmail ;
      private bool returnInSub ;
      private String A20ProfesorNombre ;
      private String A19ProfesorApellidos ;
      private String A2AlumnoNombre ;
      private String A3AlumnoApellidos ;
      private String A21ProfesorNombreCompleto ;
      private String A26CursoNombre ;
      private String A29CursoDescripcion ;
      private String A4AlumnoNombreCompleto ;
      private String A30AlumnoEmail ;
      private GXMasterPage MasterPageObj ;
      private GXWebGrid Grid1Container ;
      private GXWebGrid Grid2Container ;
      private GXWebRow Grid2Row ;
      private GXWebRow Grid1Row ;
      private GXWebColumn Grid1Column ;
      private GXWebColumn Grid2Column ;
      private IGxDataStore dsDefault ;
      private IDataStoreProvider pr_default ;
      private short[] H00112_A25CursoId ;
      private short[] H00112_A18ProfesorId ;
      private String[] H00112_A29CursoDescripcion ;
      private String[] H00112_A26CursoNombre ;
      private String[] H00112_A19ProfesorApellidos ;
      private String[] H00112_A20ProfesorNombre ;
      private short[] H00113_A25CursoId ;
      private String[] H00113_A30AlumnoEmail ;
      private bool[] H00113_n30AlumnoEmail ;
      private short[] H00113_A1AlumnoId ;
      private String[] H00113_A3AlumnoApellidos ;
      private String[] H00113_A2AlumnoNombre ;
      private int[] H00114_AGRID2_nRecordCount ;
      private msglist BackMsgLst ;
      private msglist LclMsgLst ;
      private GXWebForm Form ;
      private SdtContext AV5Context ;
   }

   public class wpprincipal__default : DataStoreHelperBase, IDataStoreHelper
   {
      public ICursor[] getCursors( )
      {
         cursorDefinitions();
         return new Cursor[] {
          new ForEachCursor(def[0])
         ,new ForEachCursor(def[1])
         ,new ForEachCursor(def[2])
       };
    }

    private static CursorDef[] def;
    private void cursorDefinitions( )
    {
       if ( def == null )
       {
          Object[] prmH00112 ;
          prmH00112 = new Object[] {
          new Object[] {"@AV5Context__Profesorid",SqlDbType.SmallInt,4,0}
          } ;
          Object[] prmH00113 ;
          prmH00113 = new Object[] {
          new Object[] {"@CursoId",SqlDbType.SmallInt,4,0}
          } ;
          Object[] prmH00114 ;
          prmH00114 = new Object[] {
          new Object[] {"@CursoId",SqlDbType.SmallInt,4,0}
          } ;
          def= new CursorDef[] {
              new CursorDef("H00112", "SELECT T1.[CursoId], T1.[ProfesorId], T2.[CursoDescripcion], T2.[CursoNombre], T3.[ProfesorApellidos], T3.[ProfesorNombre] FROM (([CursoProfesores] T1 WITH (NOLOCK) INNER JOIN [Curso] T2 WITH (NOLOCK) ON T2.[CursoId] = T1.[CursoId]) INNER JOIN [Profesor] T3 WITH (NOLOCK) ON T3.[ProfesorId] = T1.[ProfesorId]) WHERE T1.[ProfesorId] = @AV5Context__Profesorid ORDER BY T1.[CursoId], T1.[ProfesorId] ",false, GxErrorMask.GX_NOMASK | GxErrorMask.GX_MASKLOOPLOCK, false, this,prmH00112,11,0,true,false )
             ,new CursorDef("H00113", "SELECT T1.[CursoId], T2.[AlumnoEmail], T1.[AlumnoId], T2.[AlumnoApellidos], T2.[AlumnoNombre] FROM ([CursoAlumnos] T1 WITH (NOLOCK) INNER JOIN [Alumno] T2 WITH (NOLOCK) ON T2.[AlumnoId] = T1.[AlumnoId]) WHERE T1.[CursoId] = @CursoId ORDER BY T1.[CursoId] ",false, GxErrorMask.GX_NOMASK | GxErrorMask.GX_MASKLOOPLOCK, false, this,prmH00113,7,0,false,false )
             ,new CursorDef("H00114", "SELECT COUNT(*) FROM ([CursoAlumnos] T1 WITH (NOLOCK) INNER JOIN [Alumno] T2 WITH (NOLOCK) ON T2.[AlumnoId] = T1.[AlumnoId]) WHERE T1.[CursoId] = @CursoId ",false, GxErrorMask.GX_NOMASK | GxErrorMask.GX_MASKLOOPLOCK, false, this,prmH00114,1,0,false,false )
          };
       }
    }

    public void getResults( int cursor ,
                            IFieldGetter rslt ,
                            Object[] buf )
    {
       switch ( cursor )
       {
             case 0 :
                ((short[]) buf[0])[0] = rslt.getShort(1) ;
                ((short[]) buf[1])[0] = rslt.getShort(2) ;
                ((String[]) buf[2])[0] = rslt.getVarchar(3) ;
                ((String[]) buf[3])[0] = rslt.getVarchar(4) ;
                ((String[]) buf[4])[0] = rslt.getVarchar(5) ;
                ((String[]) buf[5])[0] = rslt.getVarchar(6) ;
                break;
             case 1 :
                ((short[]) buf[0])[0] = rslt.getShort(1) ;
                ((String[]) buf[1])[0] = rslt.getVarchar(2) ;
                ((bool[]) buf[2])[0] = rslt.wasNull(2);
                ((short[]) buf[3])[0] = rslt.getShort(3) ;
                ((String[]) buf[4])[0] = rslt.getVarchar(4) ;
                ((String[]) buf[5])[0] = rslt.getVarchar(5) ;
                break;
             case 2 :
                ((int[]) buf[0])[0] = rslt.getInt(1) ;
                break;
       }
    }

    public void setParameters( int cursor ,
                               IFieldSetter stmt ,
                               Object[] parms )
    {
       switch ( cursor )
       {
             case 0 :
                stmt.SetParameter(1, (short)parms[0]);
                break;
             case 1 :
                stmt.SetParameter(1, (short)parms[0]);
                break;
             case 2 :
                stmt.SetParameter(1, (short)parms[0]);
                break;
       }
    }

 }

}
